﻿//-----------------------------------------------------------------------
// <copyright file="Program.cs" company="DylanBox">
// Copyright (c) DylanBox Corporation. All rights reserved.
// </copyright>
// <summary>
//  This real-world code demonstrates the Facade pattern 
// as a MortgageApplication object which provides a simplified interface to a large subsystem 
// of classes measuring the creditworthyness of an applicant. 
// </summary>
// <reference>
//      http://www.dofactory.com/Patterns/PatternFacade.aspx
//      http://www.cnblogs.com/DylanWind/archive/2008/11/19/1336151.html
// </reference>
// <author>Dylan</author>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SDFL.KeyPoints.DesignPattern.Facade.RealWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            //外观
            Mortgage mortgage = new Mortgage();

            Customer customer = new Customer("Dylan Wang");
            bool eligable = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                " has been " + (eligable ? "Approved" : "Rejected"));
           
            
            Console.ReadLine();
        }
    }
}
